<?php


namespace Xiaoguai\DesignPattern\DP022\Element;


use Xiaoguai\DesignPattern\DP022\ElementInterface;
use Xiaoguai\DesignPattern\DP022\VisitorInterface;

class ElementB implements ElementInterface
{

    public function accept(VisitorInterface $visitor)
    {
        $visitor->visitElementB($this);
    }

    public function operationB()
    {
        // do something
        echo __CLASS__ . '::' . __METHOD__;
    }
}